The present invention relates to a correlation operation circuit and a semiconductor device, and, in particular, can be preferably used in a correlation operation circuit that detects a waveform highly correlated with a desired waveform pattern.
A technique of detecting a desired signal pattern (detection pattern) from a signal waveform input from a sensor has been desired. In the related art, a correlation between the input signal waveform and the detection pattern is obtained, so that a complicated detection pattern can be recognized, or a detection pattern having high noise tolerance can be detected.
A correlation function for obtaining the correlation can be represented by the following equation.
                              [                      Equation            ⁢                                                  ⁢            1                    ]                ⁢                                                                                                R          ⁡                      (            τ            )                          =                              ∑                          t              =              τ                                      τ              +              N              -              1                                ⁢                                    f              ⁡                              (                                  t                  -                  τ                                )                                      ⋆                          g              ⁡                              (                t                )                                                                        (        1        )            
In the equation, R(τ) represents a correlation function at time τ, f(t) represents a time series function (referred to as a “detection pattern function”) representing a detection pattern, and g(t) represents a time series function (referred to as a “measurement function”) of an input signal waveform after being measured. Namely, the detection pattern is represented by pieces of data f(0) to f(N−1) of N points from t=0 to t=N−1.
FIG. 7 is a schematic explanatory diagram of the correlation operation. The correlation function R(τ) can be calculated by performing a product-sum operation for the measured waveform g(t) at time t while being shifted by t. In FIG. 7, g(t) at τ=9 is in good agreement with the detection pattern function f(t), and thus the correlation function R(9) takes the maximum value.
Japanese Unexamined Patent Application Publication No. Hei 5 (1993)-282351 discloses a correlation function calculator. The correlation function calculator is configured to include a first storage unit into which first input data is written, a second storage unit into which second input data is written, and a product-sum operation unit that performs a product-sum operation by simultaneously reading data stored in the first storage unit and the second storage unit to obtain an autocorrelation function or a cross correlation function. Since the data necessary for the calculation can be simultaneously read, the processing time can be reduced.